import 'package:flutter/material.dart';
void main() => runApp(MyApp());

class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context){
    return MaterialApp(
      title: 'flutter widget',
      //应用程序的主题，各种的定制颜色都可以设置，用于程序主题切换
      theme: ThemeData(
        //主题色 蓝色
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: new Text('Flutter之ListView组件1'),
          centerTitle: true,
          primary: true, //是否设置内容避开状态栏
        ),
        body: new ListView(
          children: <Widget>[
            new Text(
                '这是最基础的纵向列表示例',
              textAlign: TextAlign.center,
              style: TextStyle(
                fontSize: 30.0,
                color: Colors.purple,
                fontWeight: FontWeight.bold
              ),
            ),
            new ListTile(
              leading: Icon(Icons.work),
              title: new Text('这是正在工作的样子'),
            ),
            new ListTile(
              leading: Icon(Icons.ac_unit),
              title: new Text('这是在干嘛呢不更新')
            ),
            new ListTile(
              leading: Icon(Icons.cake),//最左侧的头部，参数是一个widget
              title: new Text('这是标题'),
              subtitle: new Row(
                children: <Widget>[
                  new Text('副标题'),
                  new Icon(Icons.person)
                ],
              ),
              trailing: new Icon(Icons.save),
            ),
            new Container(
              padding: EdgeInsets.all(10.0),
              margin: EdgeInsets.all(4.0),
              child: new Image.asset('images/image-3.jpg'),
            ),
            new Container(
              padding: EdgeInsets.all(10.0),
              margin: EdgeInsets.all(4.0),
              child: new Image.asset('images/image-1.jpg'),
            )
          ],
        ),
      ),
    );
  }
}